/**
 * 
 */

$(document).ready(function() {
	
	$("#bigType").change(function(){
		var id = $("#bigType option:selected").attr("id");
		$.get(
			"admin/bigType",
			{"id":id},
			function(result){
				$("#littleType").empty(); 
				for(var i=0; i<result.length; i++){
					$("#littleType").append("<option id="+ result[i].id + " value="+ result[i].id + ">"+ result[i].name +"</option>");
			
				}
			}
		)
	})
	$("#sub").click(function(){
		$("form[name='upFileForm']").submit();
//		window.location.href="initAdminCommPage";
		//$("#upFileForm").submit();
	});
$("#upFile").change(function(){
	var url = null;  
	var fileObj = document.getElementById("upFile").files[0];
		if (window.createObjcectURL != undefined) {
			url = window.createOjcectURL(fileObj);  
		} else if (window.URL != undefined) {
			url = window.URL.createObjectURL(fileObj);  
		} else if (window.webkitURL != undefined) {
			url = window.webkitURL.createObjectURL(fileObj);  
		}
	$("#imgComm").attr("src",url);
})




});
